<%@ page import="cn.wolfcode.domain.Student" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>登录</title>
</head>
<body>
<%
    List<Student> list = (List<Student>) request.getAttribute("list");
    System.out.println(list);
    request.setAttribute("list",list);
%>
<form action="/indexServlet" method="post">
    <a href="/indexServlet?cmd=input2">添加</a>
    <table border="1" cellspacing="0" cellpadding="0" width="80%" style="text-align: center">
        <tr>
            <th>编号</th>
            <th>账号</th>
            <th>密码</th>
            <th>操作</th>
        </tr>
        <c:forEach var="list" items="${list}" varStatus="status">
            <tr class="yangshi">
                <td>${list.id}</td>
                <td>${list.username}</td>
                <td>${list.password}</td>
                <td>
                    <a href="/indexServlet?cmd=input&id=${list.id}">编辑</a>
                    <a href="/indexServlet?cmd=delete&id=${list.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</form>
</body>
</html>